﻿var status = 0;
var random = java.lang.Math.floor(Math.random() * 4);
var eff = "#fUI/UIPVP.img/MiniMapIcon/star#";
var eff1 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#";//"+ttt+"//美化1

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001 || cm.getMapId() == 910340100 || cm.getMapId() == 910340200 || cm.getMapId() == 910340300 || cm.getMapId() == 910340400 || cm.getMapId() == 910340500 || cm.getMapId() == 910340000) {
            cm.sendOk("很遗憾，您因为在特殊地图无法使用此功能.")
            cm.dispose();
        } else if (status == 0) {
        var selStr = ""+ttt+" #e#d请选择#n#k\r\n"+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+"\r\n";
       	        selStr += "#L0#" + eff + " #b余额购物#l  #L1#" + eff + " 中介商城#l  #L2#" + eff + " 购买点券#l\r\n";
		selStr += "#L3#" + eff + " #r稀有时装#l  #L4#" + eff + " 坐骑商店#l  #L5#" + eff + " 霸气椅子#l\r\n";
		selStr += "#L7#" + eff + " #d双倍经验#l  #L8#" + eff + " 道具卷轴#l  #L9#" + eff + " 功能道具#l\r\n";
		selStr += "#L10#" + eff + " #b伤害皮肤#l  #L15#" + eff + " 纪念商城#l  #L12#" + eff + " 抵用商店#l\r\n";
		selStr += "#L13#" + eff + " #r特殊商店#l  #L14#" + eff + " 抽卷道具#l\r\n";
		selStr += "\r\n"+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+"\r\n";
		selStr += "\r\n\t\t\t#b#L6#"+ttt+" 返回上一页#l#k\r\n";
        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
        case 0:
			cm.dispose();
			cm.openNpc(9310362,"gouwulibao");	
            break;
        case 1:
			//cm.sendOk("暂未开放。");
			cm.dispose();
			cm.openNpc(9310362, "timedh");	
            break;
        case 2:
			cm.dispose();
			cm.openNpc(9310362,"yue");	
            break;
		case 3:
			cm.dispose();
			cm.openNpc(9310362,"haohuasp");	
            break;
		case 4:
			cm.dispose();
			cm.openNpc(9310362,"txjz");	
            break;
		case 5:
			cm.dispose();
			cm.openNpc(9310362,"111");	
            break;
		case 6:
			cm.dispose();
			cm.openNpc(9310362);	
            break;
		case 7:
			cm.dispose();
			cm.openNpc(9310362, "shuangbei");	
            break;
		case 8:
			cm.dispose();
			cm.openNpc(9310362, "daojujuanzhou");	
            break;
		case 9:
			cm.dispose();
			cm.openNpc(9310362, "gndj");	
            break;
		case 10:
			cm.dispose();
			cm.openNpc(9310362, "shpf");	
            break;
		case 11:
			cm.dispose();
			cm.openNpc(9310362, "0");	
            break;
		case 12:
			cm.dispose();
			cm.openNpc(9310362, "16");	
            break;
		case 13:
			cm.dispose();
			cm.openNpc(9310362, "qitashangdian");	
            break;
		case 14:
			cm.dispose();
			cm.openNpc(9310362, "youxibaoku");	
            break;
		case 15:
			cm.dispose();
			cm.openNpc(9310362, "FFNlibao");	
            break;
	}
    }
}
